import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入子路由
import film from './routes/film'

import videoList from './routes/video'
import smallvideo from './routes/smallvideo'
import videos from '../views/smallvideo/video.vue'
import perform from './routes/perform'
import center from './routes/center'
import city from './routes/city'
import search from './routes/search'
import openapp from './routes/openapp'
Vue.use(VueRouter)

const routes = [
  // 电影
  ...film,
  // 城市
  city,
  //搜索
  search,
  //APP
  openapp,
  // 视频
  videoList,
  // 小视频
  smallvideo,
  // 演出
  perform,
  // 我的
  center,
  { path: '/videos', name: 'videos', component: videos, meta: { title: '视频' } },
  // 重定向
  {
    path:'/',
    name:"/",
    redirect:'/film/nowplaying'
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
